package com.xbongbong.workflow.domain.dao;

import com.xbongbong.workflow.domain.entity.WorkflowTaskLogItemEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

@Mapper
@Repository
public interface WorkflowTaskLogItemDao {

    Integer insert(WorkflowTaskLogItemEntity entity);

    void insertBatch(List<WorkflowTaskLogItemEntity> list);

    WorkflowTaskLogItemEntity getByKey(@Param("key") Long key, @Param("corpid") String corpid );

    Integer update(WorkflowTaskLogItemEntity entity);

    List<WorkflowTaskLogItemEntity> findEntities(@Param("param") Map<String, Object> param);

    Integer getEntitiesCount(@Param("param") Map<String, Object> param);

    WorkflowTaskLogItemEntity getByTaskIdNodeId(@Param("taskId") Long taskId, @Param("nodeId") Long nodeId, @Param("corpid") String corpid);

    void updateBatch(@Param("list") List<WorkflowTaskLogItemEntity> workflowTaskLogItemEntities, @Param("corpid") String corpid);

    WorkflowTaskLogItemEntity getByLogIdNodeIdOrderByAddTime(@Param("corpid") String corpid, @Param("logId") Long logId, @Param("nodeId") Long nodeId);

    void deleteByTaskIds(@Param("corpid") String corpid, @Param("taskIds") List<Long> taskIds);
}